<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>跨域测试</title>
</head>
<body>

<button id="btnSubmit">提交</button>
</body>
<script src="../plugin/jquery/jquery.js"></script>
<script>

    $('#btnSubmit').bind('click',function () {
        $.ajax({
             url:'http://localhost:8080/user/single',
            method:'get',
            dataType:'json',
            success:function (data) {

                   if(data.flag){
                       alert("通信成功！");
                   }

            }
        })
    })

</script>
</html>